package com.ruoyi.pay.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.pay.domain.WxPayLog;
import com.ruoyi.pay.mapper.WxPayLogMapper;
import com.ruoyi.pay.service.IWxPayLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * 微信用户支付记录Service业务层处理
 *
 * @author jiang
 * @date 2024-10-27
 */
@Service
public class WxPayLogServiceImpl extends ServiceImpl<WxPayLogMapper, WxPayLog> implements IWxPayLogService
{
    @Autowired
    private WxPayLogMapper wxPayLogMapper;

    @Override
    public WxPayLog selectOne(QueryWrapper payWrapper) {
        return wxPayLogMapper.selectOne(payWrapper);
    }

    @Override
    public void insert(WxPayLog wxPayLogEntity) {
        wxPayLogMapper.insert(wxPayLogEntity);
    }

    /**
     * 查询微信用户支付记录
     *
     * @param uuid 微信用户支付记录主键
     * @return 微信用户支付记录
     */
    @Override
    public WxPayLog selectWxPayLogByUuid(String uuid)
    {
        return wxPayLogMapper.selectWxpayConfigById(uuid);
    }

    /**
     * 查询微信用户支付记录列表
     *
     * @param wxPayLog 微信用户支付记录
     * @return 微信用户支付记录
     */
    @Override
    public List<WxPayLog> selectWxPayLogList(WxPayLog wxPayLog)
    {
        return wxPayLogMapper.selectWxPayLogList(wxPayLog);
    }

    /**
     * 新增微信用户支付记录
     *
     * @param wxPayLog 微信用户支付记录
     * @return 结果
     */
    @Override
    public int insertWxPayLog(WxPayLog wxPayLog)
    {
        wxPayLog.setCreateTime(DateUtils.getNowDate());
        return wxPayLogMapper.insertWxPayLog(wxPayLog);
    }

    /**
     * 修改微信用户支付记录
     *
     * @param wxPayLog 微信用户支付记录
     * @return 结果
     */
    @Override
    public int updateWxPayLog(WxPayLog wxPayLog)
    {
        return wxPayLogMapper.updateWxPayLog(wxPayLog);
    }

    /**
     * 批量删除微信用户支付记录
     *
     * @param uuids 需要删除的微信用户支付记录主键
     * @return 结果
     */
    @Override
    public int deleteWxPayLogByUuids(String[] uuids)
    {
        return wxPayLogMapper.deleteWxPayLogByUuids(uuids);
    }

    /**
     * 删除微信用户支付记录信息
     *
     * @param uuid 微信用户支付记录主键
     * @return 结果
     */
    @Override
    public int deleteWxPayLogByUuid(String uuid)
    {
        return wxPayLogMapper.deleteWxPayLogByUuid(uuid);
    }
}

